package com.heima.article.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.heima.model.article.dtos.ArticleHomeDto;
import com.heima.model.article.pojos.ApArticle;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * ap_article表对应的mapper
 */
@Mapper
public interface ApArticleMapper extends BaseMapper<ApArticle> {


    /**
     *  查询文章列表
     * @param dto 前端传的参数
     * @param type 1:查询更多     2：查询最新
     * @return
     */
    List<ApArticle> loadArticleList(@Param("dto") ArticleHomeDto dto,
                                    @Param("type") Short type);


    List<ApArticle> findArticleListByDays(Date date);
}
